using System.Collections;
using System.Collections.Generic;
using MyFrame.Lua;
using UnityEngine;
using UnityEngine.Events;
using XLua;


[Hotfix]
public class TestClass<T>{
    public void Test(T t){
        Debug.Log(t);
    }
}

/// <summary>
///
/// </summary>
[Hotfix]
public class HotfixMain : MonoBehaviour
{
    public int Age { get; set; }

    public int[] array = new int[] { 1, 2, 3 };
    public object this[int index]
    {
        get { return array[index]; }
        set { array[index] = (int)value; }
    }

    event UnityAction MyEvent;

    // Start is called before the first frame update
    void Start()
    {
        LuaMgr.Instance.Init();
        LuaMgr.Instance.DoFile("Hotfix");

        // Test("123");
        // StartCoroutine(TestCoroutine("222"));

        Debug.Log("----------------------");
        this.Age = 10;
        Debug.Log(Age);

        this[1] = 100;
        Debug.Log(array[1]);

        MyEvent += Test;
        MyEvent -= Test;

        TestClass<int> t = new TestClass<int>();
        t.Test(123);
    }

    // Update is called once per frame
    void Update() { }

    void Test(string str)
    {
        Debug.Log("Test");
    }
    void Test()
    {
        Debug.Log("Test");
    }

    IEnumerator TestCoroutine(string s)
    {
        yield return null;
        Debug.Log("TestCoroutine");
    }
}
